﻿using HCMS.CommonDtos;
using HCMS.Dtos.OAuth2;
using HCMS.Entities.OAuth2;
using HCMS.Repositories.OAuth2;
using System.Threading.Tasks;

namespace HCMS.IServices.OAuth2
{
    /// <summary>
    /// OAuth 2.0 AccessToken 应用服务 接口
    /// </summary>
    public interface IOAuth2AccessTokenAppService : ICommonAppService<OAuth2DbContext, OAuth2AccessToken>
    {
        /// <summary>
        /// 管理 列表
        /// </summary>
        /// <param name="searchArgs">搜索 参数</param>
        /// <param name="pager">分页 参数</param>
        /// <returns></returns>
        Task<ListPagerDto<object>> ManageList(SearchArgsDto searchArgs, PagerArgsDto pager);

        /// <summary>
        /// 根据应用 Id 获取 AccessToken
        /// </summary>
        /// <param name="appId">应用 Id</param>
        /// <returns></returns>
        Task<AppTokenDto> TokenByAppId(int appId);

        /// <summary>
        /// AccessToken 有效性验证
        /// </summary>
        /// <param name="token">token 信息</param>
        /// <returns></returns>
        Task<bool> TokenValidation(string token);

    }
}